{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "babfd569",
   "metadata": {},
   "source": [
    "# week02作业：课程表\n",
    "## 目前功能：\n",
    "* 每次访问时都会自动提示当前日期时间，并推送出今日全部课程。\n",
    "* 如果是周末没有课的话，则会小人得意一下疯狂大笑（不是"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "9953f299",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "今天是2021-10-02\n",
      "星期六来啦!\n",
      "今天没有课惹，本人真的是很得意嘻嘻。\n",
      "可以美美睡大觉~\n"
     ]
    }
   ],
   "source": [
    "import datetime,time\n",
    "# 当前日期\n",
    "now = datetime.date.isoformat(datetime.date.today())\n",
    "# 周几\n",
    "today = datetime.datetime.now().weekday() + 1\n",
    "# 整合一周所有课程\n",
    "data1={'day':[1],\n",
    "       '周几':['周一'],\n",
    "        '节':['8-10节'],\n",
    "       '课程':['创业基础（实践）'],\n",
    "       '地点':['1-401'],\n",
    "       '老师':['高进']\n",
    "}\n",
    "data2={'day':[2],\n",
    "       '周几':['周二'],\n",
    "       '节':[\"8-9节\"],\n",
    "       '课程':['H5互动技术与应用'],\n",
    "       '地点':['3实-308'],\n",
    "       '老师':['游鸽']\n",
    "}\n",
    "data3={'day':[2],\n",
    "       '周几':['周二'],\n",
    "       '节':[\"10-11节\"],\n",
    "       '课程':['大学英语（三）B1班'],\n",
    "       '地点':['9-202'],\n",
    "       '老师':['洪明']\n",
    "}\n",
    "data4={'day':[3],\n",
    "       '周几':['周三'],\n",
    "       '节':[\"1-2节\"],\n",
    "       '课程':['户外体育游戏'],\n",
    "       '地点':['西区体育馆东面'],\n",
    "       '老师':['赵培刚']\n",
    "}\n",
    "data5={'day':[4],\n",
    "       '周几':['周四'],\n",
    "       '节':[\"1-2节\"],\n",
    "       '课程':['大学英语（三）B1班'],\n",
    "       '地点':['9-202'],\n",
    "       '老师':['洪明']\n",
    "}\n",
    "data6={'day':[4],\n",
    "       '周几':['周四'],\n",
    "       '节':[\"3-5节\"],\n",
    "       '课程':['Python语言'],\n",
    "       '地点':['新综合楼612'],\n",
    "       '老师':['许智超']\n",
    "}\n",
    "data7={'day':[4],\n",
    "       '周几':['周四'],\n",
    "       '节':[\"8-9节\"],\n",
    "       '课程':['广告文案写作'],\n",
    "       '地点':['1-303'],\n",
    "       '老师':['罗希']\n",
    "}\n",
    "data8={'day':[4],\n",
    "       '周几':['周四'],\n",
    "       '节':[\"12-14节\"],\n",
    "       '课程':['毛概'],\n",
    "       '地点':['9-201'],\n",
    "       '老师':['张锦标']\n",
    "}\n",
    "data9={'day':[5],\n",
    "       '周几':['周五'],\n",
    "       '节':[\"1-2节\"],\n",
    "       '课程':['illustrator软件应用'],\n",
    "       '地点':['新综合楼612'],\n",
    "       '老师':['阚凤霞']\n",
    "}\n",
    "data10={'day':[5],\n",
    "       '周几':['周五'],\n",
    "       '节':[\"4-5节\"],\n",
    "       '课程':['毛概（实践）'],\n",
    "       '地点':['7-402'],\n",
    "       '老师':['杨益孜']\n",
    "}\n",
    "data = [data1,data2,data3,data4,data5,data6,data7,data8,data9,data10]\n",
    "print('今天是' + now)\n",
    "\n",
    "for key in range(len(data)):\n",
    "       if today in data[key][\"day\"]:\n",
    "              print('今天是' + str(data[key]['周几']))\n",
    "              print('上课时间：' + str(data[key]['节']) +\n",
    "                    '\\n课程名称：' + str(data[key]['课程']) +\n",
    "                    '\\n课程地点：' + str(data[key]['地点']) +\n",
    "                     '\\n任课老师：' + str(data[key]['老师']))\n",
    "       else:\n",
    "              if today in [6,7]:\n",
    "                     week = time.strftime(\"%A\")\n",
    "                     if week == \"Saturday\": \n",
    "                            print('星期六来啦!')\n",
    "                     else:\n",
    "                            print('星期天来啦！')\n",
    "                     print(\"今天没有课惹，本人真的是很得意嘻嘻。\\n可以美美睡大觉~\")\n",
    "                     break\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
